Add support for TensorFlow 2.19#1051
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
Code Review
This pull request updates the project to support TensorFlow 2.19.1 and TF-Keras 2.19.0. Key changes include updating the Bazel workspace for multi-version Python support, adjusting dependency constraints in setup.py and requirements.in, and updating documentation to include the TF_USE_LEGACY_KERAS=1 environment variable. Additionally, the requirements generation script was refactored, and redundant mutex initializations in the C++ ops were removed. Feedback suggests restoring the pyyaml exclusion in generate_requirements.sh to prevent installation conflicts and explicitly setting the legacy Keras environment variable within the tutorial notebooks to ensure compatibility.
|
@psamanoelton Sorry for the delay in getting to this. When you get a chance, could you see about updating the branch, and also resolving the merge conflicts? |
mhucka
left a comment
There was a problem hiding this comment.
Some preliminary comments. After the current merge conflicts are resolved, I'll take another look.
| --no-strip-extras \ | ||
| --no-emit-index-url \ | ||
| -o requirements.txt \ | ||
| requirements.in \ |
There was a problem hiding this comment.
pip-compile looks for requirements.in automatically, thus it doesn't have to be added as an argument.
There was a problem hiding this comment.
The version of tensorflow-quantum in the notebooks should be 0.7.7. (That's the next version, and also the working version in GitHub.)
There was a problem hiding this comment.
I am not sure I understand the purpose of these 3 files, since all they do is load requirements.txt.
There was a problem hiding this comment.
It should not be necessary to include tf-keras here because tensorflow-quantum requires tf-keras 2.19. Pip should resolve the dependencies. Is it not doing that for you?
Summary
Update TensorFlow Quantum build to support TensorFlow 2.19.1.
Keep TFQ aligned with TensorFlow 2.19.1’s Bazel and Python repository expectations, confirm Eigen remains on TensorFlow’s pinned revision, and regenerate Python dependencies from
requirements.in.Key changes
WORKSPACE@org_tensorflowto2.19.1python_version_repoto satisfy TensorFlow 2.19’s expected Python version repository layoutrequirements_lock_3_10.txt,requirements_lock_3_11.txt,requirements_lock_3_12.txt) so the same compiled requirements can be reused across the supported Python versionsrequirements.in/requirements.txt2.19.1tf-kerasrequirement to2.19.xrequirements.txtfromrequirements.inwithpip-compileunder Python 3.10TFQ source compatibility
tensorflow::mutex, which fails with TensorFlow 2.19Docs / install flow
2.19.1tf-keras==2.19.0andTF_USE_LEGACY_KERAS=1as part of the supported install pathTesting
Linux/Ubuntu 22.04 (Docker), Python 3.10, 3.11, and 3.12, Bazelisk → Bazel 6.5.0
bazel build ... release:build_pip_packagesucceeds./scripts/test_all.shand./scripts/ci_validate_tutorials.sh) pass2.19.1+tf-keras 2.19.0, Cirq1.5.0, and NumPy2.1.3Notes
2.20